Xfce Wiki

Sub domains
 

Contributing to Xfce

Purpose of this document

At the time of writing (FOSDEM 2013), the entry barrier for contributing to Xfce is substantially higher than it could be. There are several hurdles that people have to figure out themselves. There is, for example, no easily accessible list of low-hanging fruit and tasks to get started with. Also, there is no well-defined and transparent contribution process. Our aim should be to make it obvious to interested developers how they can contribute and what they can start with.

The purpose of this document is to come up with a concept for providing low-hanging fruit to the developer community and a contribution process that removes uncertainty about what the right way/format of contributing code is.

This document is only about contributing code since other areas, like translations, are already well documented.

Present State

Documentation on Contributing

The Get Involved page on the Xfce website has no information about contributing code at all. There is no documentation describing the contribution process. Possible tasks to work on are scattered across various areas of the Xfce wiki. Unless you know the wiki inside-out, you'll have a hard time finding these pages:

The Design SIG is an initiative that Xfce developers and designers use to collaborate on improving the user experience of Xfce in general. It's been quite successful in the last 1-2 years. However, the majority of Design SIG topics are complex and thus not necessarily useful for people looking to start contributing to Xfce.

The two wish lists are, unfortunately, rarely used by developers, if at all, so their usefulness is questionable.

Current Contribution Process

The current recommended (but undocumented) way to get started essentially is: subscribe to xfce4-dev@xfce.org, join us in #xfce-dev on IRC and start by fixing bugs filed on http://bugzilla.xfce.org. Code can be attached to bugs in the form of patches but that is up to contributors to figure out themselves and the desired patch format (ideally patches generated by git, with commit messages included) is not documented anywhere.

Proposals

Presenting Low-Hanging Fruit

Contribution Process

The contribution process aims to provide new contributors with a simple step-by-step process to create and submit changes to Xfce. It is inspired by how the Linux kernel community handles contributions.

1. Clone and branch

When you start working on a fix or new feature, clone the relevant repository (e.g. Thunar) and branch off the main development branch (master):

git clone git://git.xfce.org/xfce/thunar
cd thunar
git checkout -b <your name>/<branch name>

2. Write code

Work on your fix or feature in the branch you created. Important:

  • Make sure to commit frequently.
  • Make sure to pull in the latest Xfce master frequently.
  • Keep commits clean:
    • Make incremental, atomic changes (one aspect at a time).
    • Keep code working after every commit.
    • Comment the code you write.
    • Write commit messages using the standard Git message format.
    • Don't fear the rebase (against the Xfce master branch).

3. Push

Before submitting your changes for review, it is a good idea to push them to a public repository, e.g. on GitHub. This will make it easier for others to check out your branch and test it as part of their reviews. It also simplifies the merging process.

4. Submit for review

Submitting your changes for review is as simple as running a single command. In your branch, run:

git send-email --suppress-cc=self --annotate --cover-letter origin/master --to=xfce4-dev@xfce.org

This will drop you in an editor where you are being asked to define a subject and a message for the patch set you are submitting. The editor window will roughly look like this:

From 451e2ab7ea3d595476ec5e57f33da8eef1661773 Thu Jan 10 08:30:27 2013
From: Jannis Pohlmann 
Date: Thu, 10 Jan 2013 09:25:18 +0100
Subject: [PATCH 0/2] ***SUBJECT***

***MESSAGE***

... auto-generated git log and diff stats ...

Fill out the SUBJECT and MESSAGE by briefly describing what you are submitting. Then save the file and close the editor. git send-email will send your patch set to the xfce4-dev@xfce.org mailing list in the form of the above cover letter email, followed by an additional email for each commit in your branch. These mails will each include the commit message and the commit diff as plain text.

Configuring git send-email

You will need to configure a number of items for git send-email to function usefully. At minimum, you need to tell it how to actually send emails. This can be done with the following

git config --global sendemail.smtpserver mail.example.com
git config --global sendemail.smtpserverport 25

If you need encryption to use your mail server, set:

git config --global sendemail.smtpencryption starttls

If you need to log in to your server, you can set the user name in the config and then git send-email will prompt you for the password during the sending process.

git config --global sendemail.smtpuser yourmailusername

You need to teach git send-email what name and address to send the emails from. This might need to change from project to project, but if not, then:

git config --global sendemail.from "$(git config user.name) <$(git config user.email)>"

5. Review

Once submitted to xfce4-dev@xfce.org, your patches will be reviewed by other Xfce developers. These reviews should include:

  • Testing the changes.
  • Comments on:
    • Coding style and bad code design.
    • Potential issues.
    • Possible side-effects.

The reviews will be sent as replies to your cover letter and patch emails. Thanks to having the patches included in your submission as plain text, they can be commented on in-line.

Reviews may be performed in multiple rounds. If your submission is rejected, you are advised to rework your branch and re-submit it using the same approach as described above.

6. Merge

Once you get an ok, one of the reviewers will pull your branch into the official repository and merge as follows:

git checkout master
git merge --no-ff <your username>/<branch name>

This will result in an explicit merge commit, confirming in the git history that your changes have been merged.

At the bottom of the merge commit message, the reviewer should add the following lines:

Signed-off-by: <your name> <your email>
Reviewed-by: <reviewer 1> <reviewer 1 email>
Reviewed-by: <reviewer 2> <reviewer 2 email>

These fields are defined in the Linux kernel contribution guidelines and are used to confirm authorship and code reviews.